package com.gitee.huanminabc.jlambda_sql.segments;


import com.gitee.huanminabc.jlambda_sql.base.SqlFun;
import com.gitee.huanminabc.jlambda_sql.base.SqlPick;

/**
 * 结构片段
 * SqlStructureImplSegments->
 * SqlCombineImplSegments->
 * CaseWhenImplSegments->
 * SqlFunImplSegments->
 * SqlRelationImplSegments->
 * SqlConditionImplSegments->
 * SqlSpecialImplSegments->
 * AbstractSqlWrapper
 * @param <Children>
 */

public interface SqlStructureSegments<Children>  extends SqlCombineSegments<Children> {


    Children SELECT();


    Children FROM();


    Children WHERE();


    Children GROUP_BY();

    Children G_COLUMN(String sql);

    <Y> Children G_COLUMN(SqlFun<Y, ?>... columns);

    Children G_COLUMN(SqlPick<?, ?>... columns);

    Children HAVING();

    Children ORDER_BY();
    Children O_COLUMN(String sql);
    <Y> Children O_COLUMN(SqlFun<Y, ?>... columns);
    Children O_COLUMN(SqlPick<?, ?>... columns);


    Children LIMIT();
    //只显示前几条
    Children LIMIT(Integer limit);

    /**
     * 分页
     * @param limit 限制条数
     * @param offset 偏移量
     * @return
     */
    Children LIMIT(Integer limit, Integer offset);

    Children OFFSET();
    //偏移多少条开始显示
    Children OFFSET(Integer param);

    //update
    Children UPDATE();

    //set
    Children SET();


    //delete
    Children DELETE();

    //insert into
    Children INSERT_INTO();
    <Y> Children INSERT_INTO(SqlFun<Y, ?>... columns);

    Children VALUES(Object... values);


}
